/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../mixins/hairline.less';
@import '../custom.less';
@import './vars.less';

@action-sheet-prefix-cls: ~'@{css-prefix}mobile-action-sheet';

.@{action-sheet-prefix-cls} {
  position: relative;
  height: 100%;
  &__mask {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
  }

  &__content {
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--ti-mobile-action-sheet-content-bg-color, #fff);
    transform: translate(0, 100%);
    backface-visibility: hidden;
    transition: transform 0.3s;
    z-index: 500;
    overflow-y: scroll;
    border-radius: 16px 16px 0px 0px;
    &.is-toggle {
      transform: translate(0, 0);
    }
    &.is-not-content {
      z-index: 2000;
    }
  }

  &__menu {
    background-color: var(--ti-mobile-action-sheet-menu-bg-color, #fff);
  }

  &__menu.is-ellipsis &__item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding-right: 0;
  }

  &__item,
  &__cancel {
    position: relative;
    height: 40px;
    line-height: 40px;
    padding: 0px 16px;
    color: var(--ti-mobile-action-sheet-item-text-color, #333);
    font-size: var(--ti-mobile-action-sheet-item-font-size, 16px);
    text-align: center;
  }

  &__item {
    &:active {
      background-color: var(--ti-mobile-action-sheet-item-active-bg-color, #ececec);
    }

    &.is-active {
      color: var(--ti-mobile-action-sheet-item-active-text-color, #039be5);
    }
  }

  &__menu &__item {
    height: unset;
    line-height: 16px;
    padding: 16px;
    font-family:
      PingFang SC,
      PingFang SC-PingFang SC;
  }

  &__item:not(:first-child) {
    .hairline('top', var(--ti-mobile-action-sheet-item-border-color, #ddd));

    &.is-warn {
      color: var(--ti-mobile-action-sheet-item-warn-text-color, #f36f64);
    }
  }

  &__action {
    width: 100%;
    position: absolute;
    background-color: var(--ti-mobile-action-sheet-action-bg-color, #fff);
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.6s;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}
